package com.dong.factoryMode.service.impl;

import com.alibaba.fastjson.JSON;

import com.dong.factoryMode.prepare.card.IQiYiCardService;
import com.dong.factoryMode.service.ICommodity;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

/**
 * @author DongJiaQi
 * @create 2022/12/20 10:22
 * @Description: 兑换卡接口
 */
@Slf4j
public class CardCommodityImpl implements ICommodity {
    private IQiYiCardService iQiYiCardService = new IQiYiCardService();
    @Override
    public void sendCommodity(String uId, String commodityId, String bizId, Map<String, String> extMap) throws Exception {
        String mobile = queryUserMobile(uId);
        iQiYiCardService.grantToken(mobile,bizId);
        log.info("请求参数[兑换卡] => uId：{} commodityId：{} bizId：{} extMap：{}", uId, commodityId, bizId, JSON.toJSON(extMap));
        log.info("测试结果[兑换卡]：success");
    }
    private String queryUserMobile(String uId) {
        return "15200101232";
    }

}
